import config from "@/config"
import http from "@/utils/request"

export default {
	getMenuByUser: {
		url: `${config.API_URL}/api/Menu/GetMenuByUser`,
		name: "根据用户Id获取可操作权限",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getTreeList: {
		url: `${config.API_URL}/api/Menu/GetMenuTreeList`,
		name: "根据关键字获取菜单树",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getMenuTreeByRole: {
		url: `${config.API_URL}/api/Menu/GetMenuTreeByRole`,
		name: "获取角色对应菜单信息【所有菜单+可操作标识】",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getMenuPermissionListByRole: {
		url: `${config.API_URL}/api/Menu/GetMenuPermissionListByRole`,
		name: "获取角色对应可操作权限信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	forbidOrEnable: {
		url: `${config.API_URL}/api/Menu/ForbidOrEnable`,
		name: "显示或隐藏菜单",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	uploadMenu: {
		url: `${config.API_URL}/api/Menu/UploadMenu`,
		name: "上移菜单",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	downloadMenu: {
		url: `${config.API_URL}/api/Menu/DownloadMenu`,
		name: "下移菜单",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	create: {
		url: `${config.API_URL}/api/Menu/Create`,
		name: "创建菜单信息",
		post: async function(data={}){
			return await http.post(this.url, data);
		}
	},
	update: {
		url: `${config.API_URL}/api/Menu/Update`,
		name: "编辑菜单信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	deleteById: {
		url: `${config.API_URL}/api/Menu/DeleteById`,
		name: "根据Id删除菜单信息",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	},
}
